🌎 rns.kin.earth git 🌍
Commit 66096acc290ef0b8fd3b2831de83d17cd74df0b4
Parents : e35100d
Author : Mark Qvist <bc7291552be7a58f361522990465165c>
Date : 2026-05-17T17:22:25+02:00
Added ability to render raw micron in markdown files
Changes
Diff
diff --git a/RNS/Utilities/rngit/util.py b/RNS/Utilities/rngit/util.py
index 67af149e..04f9330d 100644
--- a/RNS/Utilities/rngit/util.py
+++ b/RNS/Utilities/rngit/util.py
@@ -208,19 +208,21 @@ class MarkdownToMicron:
code_content = '\n'.join(code_buffer)
if self.syntax_highlighter and code_block_lang:
- try:
- highlighted = self.syntax_highlighter.highlight(code_content, language=code_block_lang)
- result_lines.append(f"{self.CODE_BG}{self.CODE_FG}")
- result_lines.append(highlighted)
- result_lines.append(self.CODE_RESET)
+ if code_block_lang.lower() == "rawmu": result_lines.append(code_content)
+ else:
+ try:
+ highlighted = self.syntax_highlighter.highlight(code_content, language=code_block_lang)
+ result_lines.append(f"{self.CODE_BG}{self.CODE_FG}")
+ result_lines.append(highlighted)
+ result_lines.append(self.CODE_RESET)
- except Exception:
- # Fallback to plain literal block on any error
- result_lines.append(f"{self.CODE_BG}{self.CODE_FG}")
- result_lines.append(self.LITERAL_START)
- result_lines.append(self._escape_literals(code_content))
- result_lines.append(self.LITERAL_END)
- result_lines.append(self.CODE_RESET)
+ except Exception:
+ # Fallback to plain literal block on any error
+ result_lines.append(f"{self.CODE_BG}{self.CODE_FG}")
+ result_lines.append(self.LITERAL_START)
+ result_lines.append(self._escape_literals(code_content))
+ result_lines.append(self.LITERAL_END)
+ result_lines.append(self.CODE_RESET)
else:
result_lines.append(f"{self.CODE_BG}{self.CODE_FG}")
result_lines.append(self.LITERAL_START)
Served by rngit 1.5.0 - Generated in 0.04s